/*
 * VentanaIp.cpp
 *
 *  Created on: 27/11/2009
 *      Author: luis
 */

#include "VentanaIp.h"


VentanaIp::VentanaIp(Cliente& cliente ,AreaDibujo* area):input_name(),input_ip(), input_port(),
label_name("Ingrese Nombre del circuito"), label_ip("Ingrese Ip"), label_port("Ingrese Puerto")

{
	set_title("CONECTANDO");
	this->cliente = cliente;
	set_default_size(400, 180);
	get_vbox()->pack_start(label_name, Gtk::PACK_SHRINK);
	get_vbox()->pack_start(input_name, Gtk::PACK_SHRINK);
	get_vbox()->pack_start(label_ip, Gtk::PACK_SHRINK);
	get_vbox()->pack_start(input_ip, Gtk::PACK_SHRINK);
	get_vbox()->pack_start(label_port, Gtk::PACK_SHRINK);
	get_vbox()->pack_start(input_port, Gtk::PACK_SHRINK);
	add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
	this->show_all_children();
}

const std::string VentanaIp::get_nombre(){
	return this->input_name.get_text();
}


const std::string VentanaIp::get_ip(){
	return this->input_ip.get_text();
}


const int VentanaIp::get_port(){
	std::stringstream flujo(input_port.get_text());
	int puerto;
	flujo>>puerto;
	return puerto;
}


VentanaIp::~VentanaIp() {
	// TODO Auto-generated destructor stub
}
